<style type="text/css">
    .btn.btn-danger-o {
        background: transparent;
    color: {{main.syscolor || '#7c1cc9'}};
    border: 1px solid {{main.syscolor || '#7c1cc9'}};
    }
	.celltitle {background:{{main.syscolor || '#7c1cc9'}};color:#fff}
</style>
<div class="fui-page fui-page-current page-goods-list">
    <div class='fui-content' style="top:0;background:none;padding-bottom:0">
		<div class="fui-line-title" style="padding:0.3rem 1rem">
			  <div class="c" style="padding-top:1rem">
					<img ng-src="{{tomedia(pagedata.info.logo) || '../core/resource/images/nopic.jpg'}}" style="width: 120px;">
			  </div>
			  <div class="text text-danger bold">
                   <span ng-if="pagedata.message.error!=1" class="syscolor" style="font-size:0.8rem">恭喜，核验成功</span>
				   <span ng-if="pagedata.message.error==1" style="color:red;font-size:0.8rem">很遗憾，核验失败</span>
               </div>
              <div class="text text-danger">
                   <span style="color:#999;font-size:0.8rem">{{pagedata.message.msg}}</span>
               </div>
         </div>
		 <div class="fui-cell-group notop" style="margin-bottom:0.4rem;background:none">
					<div ng-if="pagedata.message.error!=1" class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">防伪编号：</div>
						<div class="fui-cell-info" style="font-size:0.65rem">{{pagedata.info.code || '*******'}}</div>
						<div class="fui-cell-remark noremark"></div>
					</div>
					<div class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">查询次数：</div>
						<div class="fui-cell-info" style="font-size:0.65rem">{{pagedata.info.count || '*******'}}次</div>
						<div class="fui-cell-remark noremark"></div>
					</div>
					<div class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">最近一次查询IP：</div>
						<div class="fui-cell-info" style="font-size:0.65rem">{{pagedata.info.userip || '*******'}}</div>
						<div class="fui-cell-remark noremark"></div>
					</div>
					<div class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">首次查询时间：</div>
						<div class="fui-cell-info" style="font-size:0.65rem">{{pagedata.info.shouci || '*******'}}</div>
						<div class="fui-cell-remark noremark"></div>
					</div>
		</div>
		<div class="detail-block" style="position: relative;margin-top:0.5rem;width:100%;padding-bottom:0">
			<div style="padding:0.4rem 0.5rem;padding-top:0">
				<div class="fui-cell-text bold celltitle" style="padding:0.5rem">商品图片</div>
				 <div class="fui-cell-group notop">
				 <div id="carousel-container" class="carousel slide" data-role="carousel" data-param-auto="true">
					<div ng-if="!pagedata.goods.video || pagedata.isvideo!=1" class="carousel-inner" role="listbox" style="max-height:20rem">
						<div ng-class="{'item':1,'active':$index==0}" ng-repeat="item in pagedata.goods.images">
							<a href="javascript:;" ng-click="previewImage(pagedata.goods.image,pagedata.goods.images);">
								<img ng-src="{{tomedia(item) || '../core/resource/images/nopic.jpg'}}" style="display: block; width: 100%; height: 100%;">
							</a>
						</div>
					</div>
					<style>
							.fui-swipe-page .fui-swipe-bullet {background: {background}; opacity: {opacity};}
							.fui-swipe-page .fui-swipe-bullet.active {opacity: 1;}
					</style>
					<div ng-if="!pagedata.goods.video || pagedata.isvideo!=1" id="carousel-jinyun" class="fui-swipe-page" style="padding: 0 5px; bottom: 10px; ">
							<div class="fui-swipe-bullet" ng-repeat="item in pagedata.goods.images" ng-class="{'active':$index==0}" data-target="#carousel-container" data-slide-to="{{$index}}"></div>
					</div>
					<video ng-if="pagedata.goods.video && pagedata.isvideo==1" style="width:100%;max-height:20rem" ng-src="{{tomedia(pagedata.goods.video)}}" ng-poster="{{tomedia(pagedata.goods.image)}}" x5-playsinline="" playsinline="" webkit-playsinline="" preload="auto"  preload="auto" controls loop="loop">
					</video>
				</div>
				<div ng-if="pagedata.goods.video" class="isvideo">
						<div style="width:6rem;margin:0 auto;">
						<span ng-class="{'videobtn':1,'active':pagedata.isvideo==1}" ng-click="pagedata.isvideo=1"><i class="icon icon-shipin1" style="font-size:0.55rem"></i> 视频</span>
						<span ng-class="{'videobtn':1,'active':pagedata.isvideo!=1}" ng-click="pagedata.isvideo=0" style="margin-left:0.5rem;"><i class="icon icon-lunbo" style="font-size:0.5rem;"></i> 图片</span>
						</div>
				</div>
				</div>
			</div>
			<div style="padding:0.4rem 0.5rem;padding-top:0">
				<div class="fui-cell-text bold celltitle" style="padding:0.5rem">溯源信息</div>
				 <div class="fui-cell-group notop">
					<div class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">产品名称：</div>
						<div class="fui-cell-info" style="font-size:0.65rem">{{pagedata.goods.title || '*******'}}</div>
						<div class="fui-cell-remark noremark"></div>
					</div>
					<div class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">产地：</div>
						<div class="fui-cell-info" style="font-size:0.65rem">{{pagedata.goods.cangdi.province + pagedata.goods.cangdi.city + pagedata.goods.cangdi.district || '*******'}}</div>
						<div class="fui-cell-remark noremark"></div>
					</div>
					<div class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">生产批次：</div>
						<div class="fui-cell-info" style="font-size:0.65rem">{{pagedata.goods.pici || '*******'}}</div>
						<div class="fui-cell-remark noremark"></div>
					</div>
					<div class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">出厂日期：</div>
						<div class="fui-cell-info" style="font-size:0.65rem">{{pagedata.goods.cangday || '*******'}}</div>
						<div class="fui-cell-remark noremark"></div>
					</div>
					<div class="fui-cell" style="padding:0.5rem;" ng-repeat="item in pagedata.goods.diytext">
						<div class="fui-cell-label" style="color:#333;width:auto">{{item.title}}：</div>
						<div class="fui-cell-info" style="font-size:0.65rem">{{item.value || '*******'}}</div>
						<div class="fui-cell-remark noremark"></div>
					</div>
					<div ng-if="pagedata.goods.url" class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">商品链接：</div>
						<div class="fui-cell-info" style="font-size:0.65rem"><span class="syscolor"  href="javascript:;" ng-click="access_json(pagedata.goods.url);">购买产品</span></div>
						<div class="fui-cell-remark noremark"></div>
					</div>
				</div>
			</div>
			<div ng-repeat="item in pagedata.goods.params">
			<div style="padding:0.4rem 0.5rem;padding-top:0">
				<div class="fui-cell-text bold celltitle" href="javascript:;" ng-click="toogle(item,'show')" style="padding:0.5rem">{{item.title}} <i class="r-f icon icon-moreunfold"></i></div>
				<div ng-if="item.show" class="content-block content-images" style="padding:0.5rem;background:#fff" ng-bind-html="trust(item.desc)"></div>
			</div>
			</div>
			<div style="padding:0.4rem 0.5rem;padding-top:0">
			<div class="fui-cell-text bold celltitle" style="padding:0.5rem">产品详情</div>
			<div class="content-block content-images" style="padding:0.5rem;background:#fff" ng-bind-html="trust(pagedata.goods.content)"></div>
			</div>
			<div style="padding:0.4rem 0.5rem;padding-top:0">
				<div class="fui-cell-text bold celltitle" style="padding:0.5rem">企业信息</div>
				 <div class="fui-cell-group notop">
					<div class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">公司名称：</div>
						<div class="fui-cell-info" style="font-size:0.65rem">{{pagedata.info.name || '*******'}}</div>
						<div class="fui-cell-remark noremark"></div>
					</div>
					<div class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">公司电话：</div>
						<a class="fui-cell-info" style="font-size:0.65rem" href="tel:{{pagedata.info.mobile}}">{{pagedata.info.mobile || '*******'}} <i class="icon icon-phone" style="font-size:0.6rem"></i></a>
						<div class="fui-cell-remark noremark"></div>
					</div>
					<div class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">公司地址：</div>
						<div class="fui-cell-info" style="font-size:0.65rem" href="javascript:;" ng-click="pagedata.openLocation();">{{pagedata.info.address || '*******'}} <i class="icon icon-map" style="font-size:0.6rem"></i></div>
						<div class="fui-cell-remark noremark"></div>
					</div>
					<div class="fui-cell" style="padding:0.5rem;">
						<div class="fui-cell-label" style="color:#333;width:auto">公司网址：</div>
						<div class="fui-cell-info" style="font-size:0.65rem">{{pagedata.info.curl || '*******'}}</div>
						<div class="fui-cell-remark noremark"></div>
					</div>
				</div>
			</div>
		</div>
        <div ng-include="sys_html('common/_copyright',true)"></div>
    </div>
</div>
<script>
	require(['bootstrap', 'hammer'], function($, Hammer){
		$('#carousel-container').carousel();
		var mc = new Hammer($('#carousel-container').get(0));
		mc.on("panleft", function(ev) {
			$('#carousel-container').carousel('next');
		});
		mc.on("panright", function(ev) {
			$('#carousel-container').carousel('prev');
		});
	});
</script>
<script language="javascript">
scope.pagedata.scancode=function () {
			console.log('scanQRCodeOK');
			wx.scanQRCode({
				needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
				scanType: ["qrCode","barCode"], // 可以指定扫二维码还是一维码，默认二者都有
				success: function (res) {
					var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
					var start = result.indexOf(',');
					result = result.substr(start+1);
					if(result.indexOf("http") != -1){
                        var url=result;
                    }else{
                        var url=scope.pagedata.url+"&code="+result
                    }
					location.href = url;
				}
			});
}
scope.pagedata.openLocation=function(item){
    wx.openLocation({
        latitude: '', // 纬度，浮点数，范围为90 ~ -90
        longitude:'', // 经度，浮点数，范围为180 ~ -180。
        name: scope.pagedata.info.name, // 位置名
        address: scope.pagedata.info.address, // 地址详情说明
        scale: 20, // 地图缩放级别,整形值,范围从1~28。默认为最大
        infoUrl: '', // 在查看位置界面底部显示的超链接,可点击跳转
        success:function(){
            //alert(1111);
        }
    });
}
</script> 